package com.mind.adjust.domain.webservice.domain;

import lombok.Data;


import com.fasterxml.jackson.annotation.JsonProperty;
import com.mind.common.utils.StringUtils;
import lombok.Data;

import java.util.Map;


@Data
public class ReCommitRequest {
    @JsonProperty("Head")
    private Head head;
    @JsonProperty("Data")
    private Body data;

    // 省略getter和setter方法

    public String validHead(){
        if (head == null){
            return "Head is required.";
        }
        if (StringUtils.isEmpty(head.getBizTransactionId())){
            return "Head.BIZTRANSACTIONID is required.";
        }
        return "";
    }

    public String validData(){
        if (StringUtils.isEmpty(head.getConsumer())){
            return "Head.CONSUMER is required.";
        }
        if (StringUtils.isEmpty(head.getCompany())){
            return "Head.COMPANY is required.";
        }
        if (StringUtils.isEmpty(head.getSignedStr())){
            return "Head.SIGNEDSTR is required.";
        }
        if(data == null){
            return "Data is required.";
        }
        if(StringUtils.isEmpty(data.getTicketId())){
            return "Data.TicketId is required.";
        }
        return "";
    }

    @Data
    public static class Head {
        @JsonProperty("BIZTRANSACTIONID")
        private String bizTransactionId;
        @JsonProperty("CONSUMER")
        private String consumer;
        @JsonProperty("COMPANY")
        private String company;
        @JsonProperty("SIGNEDSTR")
        private String signedStr;
        @JsonProperty("COUNT")
        private String count; // 非必填
        @JsonProperty("SRVLEVEL")
        private String srvLevel;
        @JsonProperty("ACCOUNT")
        private String account; // 非必填
        @JsonProperty("PASSWORD")
        private String password; // 非必填
    }

    @Data
    public static class Body {
        @JsonProperty("ticketId")
        private String ticketId;
        @JsonProperty("triggerType")
        private String triggerType;

    }

}







// Info类和其他相关类的定义...

